
ticketHub.controller('orderManageCtrls',function($scope,$http){
	
	$scope.orderID="";//订单编号
	$scope.fromDate="";//下单起始日期
	$scope.toDate="";//下单结束日期
	$scope.pnr="";//PNR号
	$scope.passengerName="";//乘客姓名
	$scope.ticketNo="";//票号
	$scope.orderType="all";//订单类型(正常、取消、改签等)
	$scope.orderSubType="all";//订单类型的细分子类型
	$scope.loginUserName="";//采购商用户登录名
	$scope.page="";//页码
	/*封装函数页面加载时加载列表数据*/
	$scope.listQuery=function(){
		layer.load(3,{shadeClose:true});
		$http({
			url:'../order/list?temp='+Math.random(),
			method:'post',
			data:{
				"loginUserName": $scope.loginUserName, 
			    "orderEndDay": $scope.toDate, 
			    "orderID": $scope.orderID, 
			    "orderStartDay": $scope.fromDate, 
			    "orderSubType": $scope.orderSubType, 
			    "orderType": $scope.orderType, 
			    "page": 1, 
			    "passengerName": $scope.passengerName, 
			    "pnr": $scope.pnr, 
			    "ticketNo": $scope.ticketNo
			}
			
		})
		.then(function(data){
			layer.closeAll();
			$scope.resultCode = data.data.data.responseMetaInfo.resultCode;
			$scope.reason = data.data.data.responseMetaInfo.reason;			
			if($scope.resultCode=="0"){
				$scope.orderList=data.data.data.orderListQueryCommonResponse.orderList;
			}
			if($scope.resultCode!="0"){
				layer.alert("错误返回 "+$scope.reason)
				$scope.orderList="";
				return false;
			}
			
		})
	}
	$scope.listQuery();
	$scope.query=$scope.listQuery;
	
})
	
	
